import fetch from 'common/src/utils/fetch';
const GRADUATION_SERV_URL="/api/graduationservice"

/**
 * 添加招生专业
 */
export function addSpecialtyPlan(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryEnrollmentSpecialtySetting/add`,
        method: 'post',
        data: data
    });
}
/**
 * 编辑招生专业
 */
export function editSpecialtyPlan(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryEnrollmentSpecialtySetting/edit`,
        method: 'post',
        data: data
    });
}
/**
 * 获取查询列表URL
 */
export function getListPageURL() {
    return  `${GRADUATION_SERV_URL}/preparatoryEnrollmentSpecialtySetting/getListPage`
}
export function getListPageURL2(data) {
    return fetch({
        url:  `${GRADUATION_SERV_URL}/preparatoryEnrollmentSpecialtySetting/getListPage`,
        method: 'post',
        data: data
    });
}
/**
 * 删除招生专业
 * @param {*} data
 */
export function deleteSpecialtyPlan(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryEnrollmentSpecialtySetting/delete`,
        method: 'delete',
        data: data
    });
}

/**
 * 导出招生专业
 * @param {d} data
 */
export function exportList(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryEnrollmentSpecialtySetting/exportList`,
        method: 'post',
        data: data,
        showMask:false
    });
}
/**
 * 导出选中的招生专业
 * @param {d} data
 */
export function exportSelectedList(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryEnrollmentSpecialtySetting/exportSelectedList`,
        method: 'post',
        data: data,
        showMask:false
    });
}
/**
 * 查询填报权限
 * @param {*} data
 */
export function getAuthority() {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryApplyAuthoritySetting/getAuthority`,
    });
}
/**
 * 设置填报权限
 */
export function setAuthority(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryApplyAuthoritySetting/setAuthority`,
        method:'post',
        data:data
    });
}

/**
 * 学生填报志愿
 * @param {*} data
 */
export function addStudentVolunteer(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/PreparatoryStudentVolunteer/add`,
        method:'post',
        data:data
    });
}
/**
 * 查询学生填报信息
 * @param {*} data
 */
export function getOne(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/PreparatoryStudentVolunteer/getOne`,
        method:'post',
        data:data
    });
}
/**
 * 查询学生可填报专业信息
 * @param {*} data
 */
export function getOfferedProfession(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/PreparatoryStudentVolunteer/getOfferedProfession`,
        method:'post',
        data:data
    });
}

/**
 * 根据学号获取学生的结业信息
 * @param {*} studentId
 */
export function getGraduationInfo(studentId) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryCompletionManagement/getGraduationInfo/`+studentId,
    });
}

/**
 * 查询学生志愿
 * @param {*} data
 */
export function getListPage() {
    return `${GRADUATION_SERV_URL}/PreparatoryStudentVolunteer/getListPage`
}
/**
 * 录取学生名单（导出excel）
 * @param {*} data
 */
export function exportList2
(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/PreparatoryStudentVolunteer/exportList`,
        method:'post',
        data:data,
        showMask:false
    });
}
/**
 * 删除学生录取
 * @param {*} data
 */
export function deleteStudentRecruit(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/PreparatoryStudentVolunteer/delete`,
        method:'delete',
        data:data
    });
}
/**
 * 调剂学生录取
 * @param {*} data
 */
export function editStudentVolunteer(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/PreparatoryStudentVolunteer/update`,
        method:'post',
        data:data
    });
}
/**
 * 按规则录取学生
 * @param {*} data
 */
export function admissionStudent(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/PreparatoryStudentVolunteer/admissionStudent`,
        method:'post',
        data:data
    });
}
/**
 * 发布和取消发布
 * @param {*} data
 */
 export function publish(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/PreparatoryStudentVolunteer/publish`,
        method:'post',
        data:data
    });
}

/**
 * 预科学生成绩分页查询
 */
export function getScoreListPage(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/PreparatoryScoreResultController/getListPage`,
        method:'post',
        data:data
    });
}

/**
 * 录入面试成绩
 * @param {*} data
 */
export function setInterviewResult(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/PreparatoryScoreResultController/setInterviewResult`,
        method:'post',
        data:data
    });
}
/**
 * 查询单个学生成绩信息
 * @param {*} data
 */
export function getOneScore(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/PreparatoryScoreResultController/getOne`,
        method:'post',
        data:data
    });
}
/**
 * 下载导入模板
 */
export function templateDownload() {
    return  `${GRADUATION_SERV_URL}/preparatoryEnrollmentSpecialtySetting/template/download`
}
/**
 * 重置填报权限
 * @param {} data
 */
export function reSetAuthority(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryApplyAuthoritySetting/reSetAuthority`,
        method:'delete',
        data:data
    });
}
/**
 * 导入招生专业设置
 */
export function importEnrollmentPlan(data) {
    return  `${GRADUATION_SERV_URL}/preparatoryEnrollmentSpecialtySetting/importEnrollmentPlan`;
}

//预科班查询
export function getClassListUrl(data) {
   return `${GRADUATION_SERV_URL}/preparatoryClass/list`
}
//预科班查询
export function getClassList(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryClass/list`,
        method:'post',
        data:data
    });
}
//预科班添加
export function addClass(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryClass`,
        method:'post',
        data:data
    });
}
//编辑预科班
export function editClass(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryClass`,
        method:'put',
        data:data
    });
}
//删除预科班
export function deleteClass(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryClass`,
        method:'delete',
        data:data
    });
}
//学生预科班关联
export function getClassStudentListUrl(data) {
    return `${GRADUATION_SERV_URL}/preparatoryClassStudent/list`
}
//删除预科班学生
export function deleteClassStudent(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryClassStudent`,
        method:'delete',
        data:data
    });
}
//添加预科班学生
export function addClassStudent(data) {
    return fetch({
        url: `${GRADUATION_SERV_URL}/preparatoryClassStudent`,
        method:'post',
        data:data
    });
}

//导出
export function exporrecruitComponent(data){
  return fetch({
      url:'/api/graduationservice/PreparatoryStudentVolunteer/exportStudentVolunteerList',
      data,
      method:'post',
      headers: { 'Content-Type': 'application/json' },
  })
}
//导出
export function exportachievementManage(data){
  return fetch({
      url:'/api/graduationservice/PreparatoryScoreResultController/export',
      data,
      method:'post',
      headers: { 'Content-Type': 'application/json' },
  })
}

export function getLogListPageURL() {
    return  `${GRADUATION_SERV_URL}/preparatoryLog/list`
}

export function getExamPlanListPageURL() {
    return  `${GRADUATION_SERV_URL}/preparatoryExamPlan/list`
}
export function addPreparatoryExamPlan(data){
    return fetch({
        url:'/api/graduationservice/preparatoryExamPlan',
        data,
        method:'post',        
    })
}
export function editPreparatoryExamPlan(data){
    return fetch({
        url:'/api/graduationservice/preparatoryExamPlan',
        data,
        method:'put',        
    })
}
export function deletePreparatoryExamPlan(data){
    return fetch({
        url:'/api/graduationservice/preparatoryExamPlan',
        data,
        method:'delete',        
    })
}
export function preparatoryExamPlanPass(data){
    return fetch({
        url:'/api/graduationservice/preparatoryExamPlan/pass',
        data,
        method:'post',        
    })
}
export function preparatoryExamPlanReject(data){
    return fetch({
        url:'/api/graduationservice/preparatoryExamPlan/reject',
        data,
        method:'post',        
    })
}
export function preparatoryExambatchApprove(data){
    return fetch({
        url:'/api/graduationservice/preparatoryExamPlan/batchApprove',
        data,
        method:'post',        
    })
}
//生成学生名单
export function generateStudent(data){
    return fetch({
        url:'/api/graduationservice/preparatoryExamPlan/generateStudent',
        data,
        method:'post',        
    })
}
//获取学生名单
export function getStudentList(data){
    return fetch({
        url:'/api/graduationservice/preparatoryExamPlan/getStudentList',
        data,
        method:'post',        
    })
}
//学生考核安排查询
export function getExamPlanStudentByPage() {
    return  `${GRADUATION_SERV_URL}/preparatoryExamPlan/getExamPlanStudentByPage`
}
//学生考核安排查询导出
export function getExamPlanStudentExcel(data){
    return fetch({
        url:'/api/graduationservice/preparatoryExamPlan/getExamPlanStudentExcel',
        data,
        method:'post',        
    })
}
//修改学生考核成绩
export function setStudentScore(data){
    return fetch({
        url:'/api/graduationservice/preparatoryExamPlan/setStudentScore',
        data,
        method:'post',        
    })
}